package com.example.demo.controller;

import com.example.demo.model.ServiceResult;
import com.example.demo.service.TSampleServiceImpl;
import com.example.demo.tool.ToolJson;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author 55358
 * @description
 * @datetime 2018/1/23 16:57
 */
@RestController
public class IndexController {
    @Autowired
    private TSampleServiceImpl sampleService;
    @RequestMapping("/")
    public void index(){
        System.out.println(123);
    }

    @RequestMapping("/selectAllSamples")
    public String selectAllSamples(){
        ServiceResult result =  sampleService.selectAllSamples();
//        if(result.getFlag()){
//
//        }
        return ToolJson.toJson(result.getData());
    }
}
